$(function () {
    $('a#editLink').bind('click', function() {
        if(!confirm('Are you sure?')) {
            return false;
        }
    });
    
    $('a#deleteLink').bind('click', function() {
        if(!confirm('Are you sure?')) {
            return false;
        }
    });
    
    $('#projectSelector').bind('change', function() {
        $('[id^=projectList]').hide();
        $('#projectList' + $(this).find('option:selected').attr('value')).show();
    });
    
    $("#projectSelector").change();
    
});

jQuery.expr[':'].Contains = function(a,i,m){
    return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
};

function filterList (list, value) {
    if(value) {
        $(list).find("span:not(:Contains(" + value + "))").parent().hide();
        $(list).find("span:Contains(" + value + ")").parent().show();
    } else {
        $(list).find("li").show();
    }
}